package com.wxy.jk.pojo.po;

import com.wxy.jk.common.foreign.anno.ForeignField;
import com.wxy.jk.common.foreign.anno.ForeignTable;
import com.wxy.jk.common.validator.BoolNumber;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;


@Data
@ForeignTable(name = "dict_item")
public class DictItem {
    //主键
    private Integer id;
    //名称
    @NotBlank(message = "名称不能为空")
    private String name;
    //值
    @NotBlank(message = "值不能为空")
    private String value;
    //排列顺序，默认值0，值越大排越前面
    @Min(value = 0, message = "序号不能是负数")
    private Integer sn;
    //是否禁用，0代表不禁用，1代表禁用
    @BoolNumber
    private Short disabled;
    //所属的类型
    @ForeignField(mainTable = DictType.class, mainField = "id", column = "type_id")
    private Integer typeId;


}
